package boc.sx.gateway.service;

import boc.sx.gateway.util.ApplicationContextUtil;

import java.util.HashMap;
import java.util.Map;

/*
 * @author zmx
 * @date 2022/8/12 16:13
 */
public class BusinessHandler {

    public static Map<String,BaseService> serviceMap = null;

    public static Object call(String service,Object msg){
        if(serviceMap ==null){
            serviceMap = ApplicationContextUtil.getBusinessService();
        }
        // 添加业务处理代码
        BaseService baseService = serviceMap.get(service);
        Object deal = msg;
        if(baseService != null){
            deal = baseService.deal(msg);
        }
        return deal;
    }


}
